﻿using Nx.Services.Syntax;
namespace Nx.Services.Tests
{
    public interface IService1
    {
        void Do1();
    }

    public interface IService2
    {
        void Do2();
    }

    public class Service : IService1, IService2
    {
        public void Do1() { }
        public void Do2() { }
    }

    public class Tests
    {
        public void ShouldHostNetTcpEndpoints()
        {
            IServiceManager manager = new ServiceManager();
            manager.AddService<Service>("asdas")
                .WithNetTcpEndpoint<IService1>("")
                .WithNetTcpEndpoint<IService2>("")
                .WithNetTcpMexEndpoint("");

            manager.AddServiceInstance<Service>("")
                .WithNetTcpEndpoint<IService1>("")
                .WithNetTcpEndpoint<IService2>("")
                .WithNetTcpMexEndpoint("");
        }

        public void ShouldHostNetNamedPipeEndpoints()
        {
            IServiceManager manager = new ServiceManager();
            manager.AddService<Service>("")
                .WithNetNamedPipeEndpoint<IService1>("")
                .WithNetNamedPipeEndpoint<IService2>("")
                .WithNetNamedPipeMexEndpoint("");

            manager.AddServiceInstance<Service>("")
                .WithNetNamedPipeEndpoint<IService1>("")
                .WithNetNamedPipeMexEndpoint("");
        }
    }
}
